home *** CD-ROM | disk | FTP | other *** search
- Path: user2.mnsinc.com!huang
- From: huang@mnsinc.com (Szu-Wen Huang)
- Newsgroups: comp.lang.c
- Subject: Re: Can anyone HELP with variable delaration? Please?
- Date: 3 Apr 1996 21:23:48 GMT
- Organization: Monumental Network Systems
- Message-ID: <4juq94$s35@news1.mnsinc.com>
- References: <4jt07b$dul@news.us.net> <3162119a.43634755@news.ucs.ubc.ca> <4juf2kINNe9v@keats.ugrad.cs.ubc.ca> <3162de71.18703379@news.ucs.ubc.ca>
- NNTP-Posting-Host: user2.mnsinc.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- James Fairweather (jamesdf@unixg.ubc.ca) wrote:
- : >Any variable can be declared constant, including strings:
-
- : > const char * const str = "Foo";
-
- : >Or do you mean literal constants?
-
- : I'm not sure what the difference is. I thought the keyword "const"
- : was just for the compiler. If you tried to modify the variable
- : declared const, the compiler would complain. Does it do something
- : else with the variable if you declare it const?
-
- Under an appropriate OS, the data would be placed in a read-only portion
- of memory so that you can't write to the data even by aliasing.
-